<%@page import="model.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
	String eid="";
	User u =new User();
	Message e= new Message();
	int sp = e.getSizeDB();
	/* get info where error */
	String n = ((String)request.getAttribute("n"));
	String m = (String) request.getAttribute("m");
	String t = ((String)request.getAttribute("t"));
	String et = (String) request.getAttribute("et");
	String en = ((String)request.getAttribute("en"));
	String em = (String) request.getAttribute("em");
	n = (n==null)? "":n ;
	m = (m==null)? "":m ;
	t = (t==null)? "":t ;
	et = (et==null)? "":et ;
	en = (en==null)? "*":en ;
	em = (em==null)? "*":em ;
	//kiem tra có phải admin không nếu khong thi redirect home
	if (!u.isAdmin((String) session.getAttribute("lv"))) {
		response.sendRedirect("../index.jsp");
	}
%>
<title>MYFILM - Add Message</title>
		<form action="AddMessage" onsubmit="return validate(this)" method="post">
			<fieldset>
				<legend>Add Message</legend>
				<div>
					<label for="n">Message Name: <span class="required"><%=en %></span></label>
					<input type="text" name="n" id="von" value="<%=n %>" size="20" maxlength="150" tabindex="1"/>
				</div>
				<div>
					<label for="n">Message Title: <span class="required"> <%=et%></span></label>
					<input type="text" name="t" id="von" value="<%=t%>" size="20" maxlength="150" tabindex="1"/>
				</div>
				<div>
					<label for="m">Message: <span class="required"><%=em %></span></label> 
					<textarea name="m" rows="3" cols="50" ><%=m %></textarea>
				</div>
				<input type="hidden" name="uid" value="<%=session.getAttribute("lv")%>">
			</fieldset>
			<p>
				<input type="submit" name="submit" value="Add Message" />
			</p>
		</form>